{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/root/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:16: DeprecationWarning: Call to deprecated `__getitem__` (Method will be removed in 4.0.0, use self.wv.__getitem__() instead).\n",
      "  app.launch_new_instance()\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD8CAYAAABzTgP2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAIABJREFUeJzt3Xt8VdWZ//HPY4iQFJGrVAgMsYJISAgkBDSNUFEuP1GQylRFBSlFRx2vg8TRsU4vTiw6tngt490XCgUVGHEUKEFAkAKCIhaFxCBEFA2XEkiAwPP7I4eYHQMCOcnJ5ft+vc4re6+99j7PWRzyZK+991rm7oiIiBxxSqQDEBGR2kWJQUREApQYREQkQIlBREQClBhERCRAiUFERAKUGEREJECJQUREApQYREQkoFGkAzgZrVu39k6dOkU6DBGROmX16tXfunubH6pXJxNDp06dWLVqVaTDEBGpU8xs8/HUU1eSiIgEKDGIiEiAEoOIiAQoMYiISIASg4iIBCgxiIhIgBKDiIgEKDGIiEiAEoOIiAQoMYiISIASg4iIBCgxiIhIgBKDiIgEKDGIiEiAEoOIiASEJTGY2WAz+9TMNplZZiXbG5vZ9ND2FWbWKVSeZmZrQ68PzezycMQjIiInr8qJwcyigCeAIUA34Coz61ah2i+Bne5+NvAo8FCo/GMg1d2TgcHAn82sTk4eJCJSX4TjjCEN2OTuue5+AJgGDKtQZxjwYmh5JjDAzMzd97l7Sai8CeBhiEdERKogHImhPbCl3PrWUFmldUKJYDfQCsDM+pjZemAdcGO5RCEiIhEQ8YvP7r7C3ROA3sA9ZtaksnpmNt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F+AT4C3gZvd/VDF95DwqjgtZ+Mfn01swgCuH3Exffr0Ydy4cbRo0eKo+0+dOpVnn32WHj16kJCQwOzZs2sibJEyFf+4KTns/HbuJ3yweWegXvk5xjMzM3nmmWcoKioiPT1dN00cQ1hSpru/BbxVoez+csvFwMiK+4W2/R74fTjikONT2bSczdIu5/S0y/k465Kyso8//rhs+d/+7d/KluPj43n77berN0iRY6hszvHig4f4v4+3Maht5fvk5OSQmJhIYmIiK1euZMOGDXTo0IE9e/bUQMR1i558boDaNY85oXKR2uZoc47v3HfwqPv88Y9/pHv37iQlJREdHc2QIUNISkoiKiqKHj168Oijj1ZXuHWO5nxugI6chpf/iysmOor/GpGoiXfqsaZNm1JYWBjpMMJCc46fHM35LEc1vGd7/mtEIu2bx2CU/mdSUpC6RHOOVy9dlm+gNC1n3TR8+HC2bNlCcXExt912G+PHj6dp06bcdtttvPnmm8TExDB79mzatm3L559/ztVXX01hYSHDhlUcjKBu05zj1UtdSSJ1yI4dO2jZsiVFRUX07t2bd999l9atWzNnzhwuvfRS7r77bpo1a8Z9993HZZddxhVXXMF1113HE088wcSJE+tNV5KcHHUlidRDkydPpkePHvTt25ctW7awceNGTj31VIYOHQp894Q6wHvvvcdVV10FwLXXXhupkKUOUleSSC1W/gn1H+34lEMr32L18uXExsbSv39/iouLiY6OpnRMytIn1MuPC3SkXORE6IxBpJaq+BDX9oKdbNlrzPt0Jxs2bOD9998/5v7p6elMmzYNKH0oUeR4KTGI1FIVH+KKiU/hUMkhrh50PpmZmfTt2/eY+//pT3/iiSeeIDExkfz8SocgE6mULj6L1FLxmXOp7H+nAZ+Xe0K9qnbt2sUrr7zCTTfdxKJFizSoXD2mi89SbRYtWlR2sXPq1KkkJSXRrVs3zjrrLD788MPA9orGjRvHJ598UpPh1lk19YT6rl27ePLJJ8N6TKnblBjkBx06dPRxDePj43n33Xd56623OHToEOPHjz/msZ555hm6das486tUpqYe4srMzCQnJ4fk5GQmTJhAYWEhV1xxBV27dmXUqFEc6VVYvXo1/fr1IyUlhUGDBrFt2/dHM5X6QXcl1XOTJk2icePG3Hrrrdxxxx18+OGHLFy4kIULF/Lss88ydOhQHnzwQdydSy65hIceeggoHT7hhhtuYMGCBTzxxBMUFhZy++23Exsby09/+tOy459//vkA/Mu//Atff/01X375JRMmTODrr7+mZ8+eFBUVkZKSwtlnn81pp53Gm2++SY8ePVi2bBk5OTk0atSItm3bMnbsWFq1asXDDz+MmZGUlMTLL78ckTarLWrqIa6srCw+/vhj1q5dy6JFixg2bBjr16+nXbt2pKen895779GnTx/+9V//ldmzZ9OmTRumT5/Ovffey3PPPRfWWKR2UGKo5zIyMnjkkUe49dZbWbVqFfv37+fgwYMsWbKELl26MHHiRFavXk2LFi0YOHAgs2bNYvjw4ezdu5c+ffrwyCOPUFxcTOfOnVm4cCFnn302v/jFL773PllZWWVdSNdccw1Dhw6lXbt2rF69uuyXy5IlS3jppZf44osveOqpp8jMzKRJkybcfffdREdHM3r0aJYtW0br1q3ZsWNHBFqr9onEE+ppaWnExcUBkJycTF5eHs2bN+fjjz/m4osvBkrPIs8888yyfcpfp5C6T4mhnjpy/3t+wR6++ut7vLJkA40bN6ZXr16sWrWKJUuWcOmll9K/f3/atGkDwKhRo1i8eDHDhw8nKiqKn//85wBs2LCB+Ph4OnfuDMA111zDlClTAu+3fPlydu7cyUMPPcS6des477zz2Lp1K1999RVxcXEUFBTQoUMHdu7cyYoVK7j++uv57LPPiImJoXPnzsTHxzNy5Ehat24NQMuWLWuwtRqmI9+RzZvz2PHtXmatyac535+5r6SkBHcnISGB5cuXV3qsI9cplBjqB11jqIfK3/9OVCOsWRvu+N2faHlWdzIyMsjOzmbTpk106tTpqMdo0qRJ2cxXx3qf9KyFtB/7OGNuup2WbdvTqlUroPSXy8iRI5k5cya5ubn07t27bL8xY8awbt06CgoKePbZZ/n88881IXsNK/8dsVNjOFC0l3teX8fSjd+U1bn//vvLZuc755xz2LBhA7fffjuTJk0iNTWVLl268Otf/xr4/nUKqduUGOqh783QF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zRLgtegLtQsvdgfxIf56qvBrcGQMwDHgxtPwiMLySOoOA+e6+w913AvOBwe6+z92zAdz9APABEFcDMVeHk24HAHd/39231Uik1SMN2OTuuaF/y2mUtkl55dtoJjDAzCxUPs3d97v758Cm0PHqopNuB3ff6+5LgeKaC7daVaUt1rj7l6Hy9UCMmTWukairQUNMDG3L/UL7CmhbSZ32wJZy61tDZWXMrDlwKfDX6giyBoSlHeqw4/lsZXXcvQTYDbQ6zn3riqq0Q30Trrb4OfCBu++vpjirXaNIB1AdzGwB8ONKNt1bfsXd3cxO+LYsM2sEvApMdvfck4uy+lV3O4hIkJklAA8BAyMdS1XUy8Tg7hcdbZuZfW1mZ7r7NjM7E9heSbV8oH+59ThgUbn1KcBGd/9jGMKtNjXQDnVZPtCh3HpcqKyyOltDfwycDhQc5751RVXaob6pUluYWRzwBnCdu+dUf7jVpyF2Jc0BjtxdMxqYXUmdd4CBZtYidLfOwFAZZvY7Sr8Mt9dArNWpSu1QD6wEOptZvJmdSumFxDkV6pRvoyuAhV56dXEOcGXoDpV4oDPwtxqKO9yq0g71zUm3RahreS6lN3S8V2MRV5dIX/2u6Rel/YF/BTYCC4CWofJU4Jly9cZSelFxE3B9qCwOcODvwNrQa1ykP1NNt0Oo/A+U9sEeDv18INKf6STa4P8Bn1F6J8q9obLfAJeFlpsAM0Kf/W/AWeX2vTe036fU0TvTwtQOecAOoDD0PehW0/HXhrYA7gP2lvu9sBY4I9Kf52RfevJZREQCGmJXkoiIHIMSg4iIBCgxiIhIgBKDiIgEKDGIiEiAEoOIiAQoMYiISIASg4iIBPx//J2ZME7CE90AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from gensim.models import Word2Vec\n",
    "from sklearn.decomposition import PCA\n",
    "from matplotlib import pyplot\n",
    "%matplotlib inline\n",
    "\n",
    "# 训练的语料\n",
    "sentences = [['this', 'is', 'the', 'first', 'sentence', 'for', 'word2vec'],\n",
    "\t\t\t['this', 'is', 'the', 'second', 'sentence'],\n",
    "\t\t\t['yet', 'another', 'sentence'],\n",
    "\t\t\t['one', 'more', 'sentence'],\n",
    "\t\t\t['and', 'the', 'final', 'sentence']]\n",
    "# 利用语料训练模型\n",
    "model = Word2Vec(sentences,window=5, min_count=1)\n",
    "\n",
    "# 基于2d PCA拟合数据\n",
    "X = model[model.wv.vocab]\n",
    "pca = PCA(n_components=2)\n",
    "result = pca.fit_transform(X)\n",
    "# 可视化展示\n",
    "pyplot.scatter(result[:, 0], result[:, 1])\n",
    "words = list(model.wv.vocab)\n",
    "for i, word in enumerate(words):\n",
    "\tpyplot.annotate(word, xy=(result[i, 0], result[i, 1]))\n",
    "pyplot.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
